<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<SignUpForm>" %>

<%@ Import Namespace="DotNetOpenAuth.OpenId.Extensions.SimpleRegistration" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<asp:Content ID="Content4" ContentPlaceHolderID="titleContent" runat="server">
    Sign up
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="toptone" runat="server">
    <h1>
        Sign Up for an account</h1>
    <h3>
        <%= ViewData.Model.EntreatyMessage %></h3>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContentPlaceHolder" runat="server">
    <% using (Html.BeginForm())
       { %>
    <div id="sign_up_form">
        <div>
            <fieldset class="container">
                <legend>Account Information</legend>
                <p>
                    <label for="EmailAddress">
                        Email:</label>
                    <%= Html.TextBox("EmailAddress", ViewData.Model.EmailAddress, new {@class="wideInput"})%>
                    <%= Html.ValidationMessage("EmailAddress")%>
                </p>
                <p>
                    <label for="WantsMonthlyNewsUpdates" class="checkBoxLabel">
                        Monthly news updates</label>
                    <%= Html.CheckBox("WantsMonthlyNewsUpdates", ViewData.Model.WantsMonthlyNewsUpdates, true)%>
                    *we promise not to misuse your email in any way.
                    <%= Html.ValidationMessage("WantsMonthlyNewsUpdates")%>
                </p>
                <p>
                    <label for="FirstName">
                        First Name:</label>
                    <%= Html.TextBox("FirstName")%>
                    <%= Html.ValidationMessage("FirstName")%>
                </p>
                <p>
                    <label for="FirstName">
                        Last Name:</label>
                    <%= Html.TextBox("LastName")%>
                    <%= Html.ValidationMessage("LastName")%>
                </p>
                <p>
                    <label for="password">
                        Password:</label>
                    <%= Html.Password("Password")%>
                    <%= Html.ValidationMessage("Password")%>
                </p>
                <p>
                    <label for="confirmPassword">
                        Confirm password:</label>
                    <%= Html.Password("ConfirmPassword") %>
                    <%= Html.ValidationMessage("ConfirmPassword")%>
                </p>
                <!-- TODO gender and birthday need input builders and xval validation required for above--->
                <p>
                    <label for="Gender">
                        Gender:</label>
                    <%= this.Select("Gender").Options(Model.Genders)%>
                    <%= Html.ValidationMessage("Genders")%>
                </p>
                <p>
                    <label for="Birthday">Birthday:</label>
                    <%= Html.TextBox("Birthday", "")%>
               </p>
                
            </fieldset>
        </div>
        <div>
        </div>
        <div>
            <br />
            <br />
        </div>
        <div class="captcha">
            <fieldset>
                <legend>Security check</legend>
                <p>
                    enter both words below, separated by a space</p>
                <%= Html.GenerateCaptcha() %>
            </fieldset>
        </div>
        <div>
            <br />
            <br />
        </div>
        <div>
            <%= Html.SubmitButton("btnSave", "Sign Up") %>
        </div>
        <div>
            <%= Html.ValidationSummary() %><br />
            <br />
        </div>
    </div>
    <% } %>

    <script type="text/javascript">
        $(function() {
            $('#Birthday').datepicker({
                changeMonth: true,
                changeYear: true,
                yearRange: '1880:<%= DateTime.Now.Year %>',
                dateFormat: 'yy-mm-dd'                
            });
        });
        //http://jqueryui.com/demos/datepicker/#option-dateFormat
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="headContentPlaceHolder" runat="server">
</asp:Content>
